export function isPowerOf2(num): boolean {
  return (num & (num - 1)) === 0;
}

export function excludeBit(
  from: number,
  arr: number[],
  idxs: number[]
): number[] {
  const mask = 1 << (from - 1);
  return arr.map((num, idx) => (idxs.includes(idx) ? num & ~mask : num));
}
